package core.toolbox.autoLogin;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;

/**
 * Created by Administrator on 2017/3/15.
 */
public class UserLogin {
    public static void userlogin(){
        UsernamePasswordToken token = new UsernamePasswordToken("qaz","123");
        Subject currentuser = SecurityUtils.getSubject();
        if (!currentuser.isAuthenticated())
            currentuser.login(token);
    }

}
